/**
 * 
 */
package com.et114.modules.content.services;

import java.util.List;

import com.et114.components.simpletable.DataList;
import com.et114.core.services.impl.BaseServicesImpl;
import com.et114.modules.content.dao.CommonContentDao;
import com.et114.modules.content.dao.CommonTypeDao;
import com.et114.modules.content.vo.CommonContent;
import com.et114.modules.content.vo.CommonType;

/*
 * @author guanhw
 */
public class CommonContentImpl extends BaseServicesImpl {
	private CommonContentDao  commonContentDao ; 
	private CommonTypeDao commonTypeDao ;
	public void setCommonContentDao ( CommonContentDao commonContentDao ) {
		this.commonContentDao = commonContentDao;
	}
	public void setCommonTypeDao ( CommonTypeDao commonTypeDao ) {
		this.commonTypeDao = commonTypeDao;
	} 
	
	
	public DataList getCommonTypes( CommonType commonType ) throws Exception {
		return commonTypeDao.getCommonTypes ( commonType ) ;
	}
	
	
	public List< CommonType > getRootCommonTypes( CommonType commonType ) throws Exception { 
		return commonTypeDao.getRootCommonTypes ( commonType ) ;
	}
	
	public List< CommonType > getRootCommonTypesCacheModel( CommonType commonType ) throws Exception {  
		return commonTypeDao.getRootCommonTypesCacheModel ( commonType ) ;
	}
	
	public CommonType getCommonTypeById( Long id ) throws Exception {
		return commonTypeDao.getCommonTypeById ( id ) ; 
	}
	
	public Long saveCommonType( CommonType commonType ) throws Exception {
		return commonTypeDao.saveCommonType ( commonType ) ;
	}
	
	public void updateCommonType( CommonType commonType ) throws Exception {
		commonTypeDao.updateCommonType ( commonType ) ; 
	}
	
	public void removeCommonType( Long id ) throws Exception {
		commonTypeDao.removeCommonType ( id ) ;
		commonContentDao.removeCommonContentByTypeId ( id ) ; 
	}
	
	
	public DataList getCommonContents( CommonContent cc ) throws Exception {
		return commonContentDao.getCommonContents ( cc ) ; 
	}
	
	public CommonContent getCommonContentById( Long id  ) throws Exception {
		return commonContentDao.getCommonContentById( id ) ;
	}
	
	public DataList getCommonContentsCacheModel( CommonType cc ) throws Exception {
		return commonContentDao.getCommonContentsCacheModel ( cc ) ; 
	}
	
	public List< CommonContent > getCommonContentsNpageCacheModel( CommonType cc ) throws Exception {
		return commonContentDao.getCommonContentsNpageCacheModel ( cc ) ; 
	}

	public CommonContent  getCommonContentByIdCacheModel ( Long id ) throws Exception {
		return commonContentDao.getCommonContentByIdCacheModel ( id ) ;
	}
	
	
	public Long saveCommonContent( CommonContent cc ) throws Exception {
		return commonContentDao.saveCommonContent ( cc ) ; 
	}
	
	public void updateCommonContent( CommonContent cc ) throws Exception {
		commonContentDao.updateCommonContent ( cc )  ; 
	}
	
	
	public void removeCommonContent( Long id ) throws Exception {
		commonContentDao.removeCommonContent ( id ) ; 
	}
	
	public void removeCommonContentByTypeId( Long typeId ) throws Exception {
		commonContentDao.removeCommonContentByTypeId ( typeId ) ; 
	}	
	
	
}
